package com.ray.service.impl;

import com.ray.entity.ProductCategory;
import com.ray.repository.ProductCategoryRepository;
import com.ray.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private ProductCategoryRepository categoryRepository;

    @Override
    public ProductCategory findOne(Integer id) {
        return categoryRepository.getOne(id);
    }


    @Override
    public List<ProductCategory> findAll() {
        return categoryRepository.findAll();
    }
}
